<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<script>
	window.onload=function()
	{
		canvas = document.getElementById('mycanvas');
		ctx = canvas.getContext('2d');
		
		ctx.lineWidth='1';
		ctx.strokeStyle='#ffffff';
		ctx.moveTo(100, 20);
		ctx.lineTo(100,165);
		ctx.moveTo(90, 150);
		ctx.lineTo(235, 150);
		ctx.stroke();
		ctx.fillRect(100, 50, 30, 100);
		ctx.fillRect(130, 100, 30, 50);
		ctx.fillRect(160, 70, 30, 80);
		ctx.fillRect(190, 85, 30, 65);
		ctx.strokeRect(100, 50, 30, 100);
		ctx.strokeRect(130, 100, 30, 50);
		ctx.strokeRect(160, 70, 30, 80);
		ctx.strokeRect(190, 85, 30, 65);
		
		ctx.strokeStyle='#000000';
		ctx.moveTo(100, 180);
		ctx.lineTo(100, 310);
		ctx.moveTo(90, 300);
		ctx.lineTo(280, 300);
		ctx.stroke();
		ctx.strokeStyle='#ff6666';
		ctx.beginPath();
		ctx.moveTo(100,200);
		ctx.lineTo(130,180);
		ctx.lineTo(170,220);
		ctx.lineTo(200,210);
		ctx.lineTo(230,270);
		ctx.lineTo(260,220);
		ctx.stroke();
		var i=0;
		siv = setInterval('i=packman(i)', 1000);
		
	}
	function packman(i)
	{
		if(i<1)
		{
			ctx.strokeStyle='#0000ff';
			ctx.fillStyle='#0000ff';
			ctx.beginPath();
			ctx.moveTo(150, 400);
			ctx.arc(150, 400, 45, Math.PI*1.9, Math.PI*0.1, true);
			ctx.closePath();
			ctx.fill();
			ctx.stroke();
			
			ctx.strokeStyle='#ffffff';
			ctx.fillStyle='#ffffff';
			ctx.beginPath();
			ctx.arc(160, 370, 5, Math.PI*2, Math.PI*0, true);
			ctx.fill();
			ctx.stroke();
			i=1;
		}
		else
		{
			ctx.strokeStyle='#0000ff';
			ctx.fillStyle='#0000ff';
			ctx.beginPath();
			ctx.moveTo(150, 400);
			ctx.arc(150, 400, 45, Math.PI*2, Math.PI*0, true);
			ctx.closePath();
			ctx.fill();
			ctx.stroke();
			
			ctx.strokeStyle='#ffffff';
			ctx.fillStyle='#ffffff';
			ctx.beginPath();
			ctx.arc(160, 370, 5, Math.PI*2, Math.PI*0, true);
			ctx.fill();
			ctx.stroke();
			i=0;
		}
		return i;
	}
</script>

</head>
<body>
	<canvas id='mycanvas' width='600px' height='500px'>
	</canvas>
</body>
</html>